﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using PcProject.Domain.Models.Entities;
using PcProject.Application.Service.AutoMapper;

namespace PcProject.Application.Service.Products
{
    public interface IProductService
    {
        /// <summary>
        /// 显示+分页+查询
        /// </summary>
        /// <param name="pname">查询参数</param>
        /// <param name="pageIndex">页数</param>
        /// <param name="pageSize">条数</param>
        /// <param name="totalCount">总条数</param>
        /// <returns></returns>
        List<Product> GetProductsAsync(string pname, int pageIndex, int pageSize, out int totalCount);

        /// <summary>
        /// 添加
        /// </summary>
        /// <param name="obj">表单参数</param>
        /// <returns></returns>
        Task<int> InsertAsync(ProductDto obj);

        /// <summary>
        /// 删除
        /// </summary>
        /// <param name="id">主键</param>
        /// <returns></returns>
        Task<int> DeleAsync(int id);

        /// <summary>
        /// 反填
        /// </summary>
        /// <param name="id">主键</param>
        /// <returns></returns>
        Task<Product> FillAsync(int id);

        /// <summary>
        /// 商品详情
        /// </summary>
        /// <param name="id">主键</param>
        /// <returns></returns>
        ProductDto FillsAsync(int id);

        /// <summary>
        /// 加入浏览记录
        /// </summary>
        /// <param name="obj">参数</param>
        /// <returns></returns>
        int AddBrowse(Browse obj);

        /// <summary>
        /// 根据ID查找商品信息
        /// </summary>
        /// <param name="b">参数</param>
        /// <returns></returns>
        List<Product> Products(string b);

        /// <summary>
        /// 修改
        /// </summary>
        /// <param name="obj">表单参数</param>
        /// <returns></returns>

        Task<int> UptAsync(ProductDto obj);

        /// <summary>
        /// 砍价修改
        /// </summary>
        /// <param name="obj">参数</param>
        /// <returns></returns>
        public int Upt(Product obj);

        /// <summary>
        /// 加入回收站
        /// </summary>
        /// <param name="id">主键</param>
        /// <returns></returns>
        Task<int> RecycAsync(int id);

        /// <summary>
        /// 回收站显示分页
        /// </summary>
        /// <param name="pageIndex">页数</param>
        /// <param name="pageSize">条数</param>
        /// <param name="totalCount">总条数</param>
        /// <returns></returns>
        List<Product> GetRecycAsync(int pageIndex, int pageSize, out int totalCount);

        /// <summary>
        /// 还原回收站
        /// </summary>
        /// <param name="id">主键</param>
        /// <returns></returns>
        Task<int> ResetAsync(int id);

    }
}
